<?php @session_start();?>
<?php 
	if($_SESSION['nn']=="en")
	{
		$_SESSION['nn']=="en";
	} 
	else
	{
		$_SESSION['nn'] = "vn";
	}
?>

<?php
    
   require_once('includes/general.php');
   if(!tep_db_checkDb()) die('khong ket noi dc csdl');   
?>

<?php
       // Khoi dong session    
$s_id = session_id();    // Bien s_id        
$time = time();            // Lay thoi gian hien tai 
$time_secs = 900;        // Thoi gian tinh bang seconds de delete & insert cai $s_id    moi, test tren localhost thi cho no bang 3 seconds de nhanh thay ket qua, ch?y trên host thì d? 900 = 15 phút là v?a 
$time_out = $time - $time_secs;    // Lay thoi gian hien tai    

@mysql_query("DELETE FROM tbl_stats WHERE s_time < '$time_out'");                // Delete tat ca nhung rows trong khoang thoi gian qui dinh san
@mysql_query("DELETE FROM tbl_stats WHERE s_id = '$s_id'");                        // Delete cai $s_id cua chinh thang nay
@mysql_query("INSERT INTO tbl_stats (s_id, s_time) VALUES ('$s_id', '$time')");    // Delete no xong lai insert chinh no
$user_online = @mysql_num_rows(@mysql_query("SELECT id FROM tbl_stats"));        // Dem so dong trong table stats, chinh la so nguoi dang online
// Them 1 cai, xem page nay da duoc mo bao nhieu lan:
list($page_visited) = @mysql_fetch_array(@mysql_query("SELECT MAX(id) FROM tbl_stats"));
// Xong rui, cho no ra thui
//echo "Online: <b>".$user_online."</b><br>";
//echo "Trang nay duoc mo: <b>".$page_visited."</b> lan";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta name="author" content="thihien" />
    <link href="css/reset.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>

	<title>Thuan Vinh Dat</title>
    
</head>

<body>

    <!-- bat dau warrper -->
    <div id="wrapper">
        <!-- bat dau header -->
        <div id="header">
            <!-- bat dau banner -->
            <div id="banner">
            </div>
            <!-- ket thuc banner -->
            
            <!-- bat dau menutop -->
            <div id="menu_top">
              <div id="menu_top_1">  
               
                    <ul>
                     <?php
                    if($_SESSION['nn']=='vn'){ 
                    ?>
                        <li>
                            <a href="<?php echo '?page=trangchu' ?>" class="trangchu" style="border-left: none;">Trang chủ </a>
                        </li>
                        
                         <li>
                            <a href="<?php echo '?page=gioithieu' ?>" >giới thiệu</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=sanpham' ?>" >sản phẩm</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=dichvu' ?>">dịch vụ</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=tintuc' ?>" >tin tức</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=FQAs' ?>" >FQAs</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=lienhe' ?>" class="lienhe" >liên hệ</a>
                        </li>
                        
                    
                    <?php
                    }
                    if($_SESSION['nn']=='en'){?>
                    
                        
                        <li>
                            <a href="<?php echo '?page=trangchu' ?>" class="trangchu" style="border-left: none;">index</a>
                        </li>
                        
                         <li>
                            <a href="<?php echo '?page=gioithieu' ?>" >introduce</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=sanpham' ?>" >product</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=dichvu' ?>">service</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=tintuc' ?>" >news</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=FQAs' ?>" >FQAs</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=lienhe' ?>" class="lienhe" >contact</a>
                        </li>
                       <?php    
                    }
                    ?>
                    <li>
                            <a href="xl_vn.php" class="ngonngu"  ><img src="images/V.gif" /></a>
                        </li>
                        <li>
                            <a href="xl_en.php" class="ngonngu" style="border-right: none;" ><img src="images/E.gif" /></a>
                        </li>
                    </ul>
                    
                    
              </div>
             
                    
            </div>
            <!-- ket thuc menutop -->
        </div>
        <div id="duongvien"></div>
        <!-- ket thuc header -->    
        
        <!-- bat dau main -->
        <div id="main">
            <!-- bat dau menu left -->
            
            <div id="menu_left">
            
                <!--bat dau danh muc san pham-->
                <div id="danhmucsanpham">
                <?php
                if($_SESSION['nn']=='vn')
                                        {
                    echo '<div class="tieude"><h3>Danh Mục Sản Phẩm</h3></div>';
                    
                }?>
                <?php 
                if($_SESSION['nn']=='en')
                {
                    echo '<div class="tieude"><h3>Product list</h3></div>';
                    
                }?>
                    <div class="menu">
                        <ul>
                            <?php 
                                $sql='select *from tbl_danh_muc_san_pham';
                                $kq=tep_db_query($sql);
                                    while($item=tep_db_fetch_array($kq))
                                    {
                                        if($_SESSION['nn']=='vn')
                                        {
                            ?>
                                            <li><a href="<?php echo '?madanhmucsanpham='.$item['id'].'' ?>"><?php echo ''.$item['ten_danh_muc_san_pham_vn'].'' ?></a></li>
                            
                            <?php        
                                        }
                                        if($_SESSION['nn']=='en')
                                        {?>
                                            
                                            <li><a href="<?php echo '?madanhmucsanpham='.$item['id'].'' ?>"><?php echo ''.$item['ten_danh_muc_san_pham_en'].'' ?></a></li>
                            
                                        
                                        <?php    
                                        }
                                    }
                            
                            ?> 
                        </ul>                   
                    </div>
                
                </div>
                    
                <!-- ket thuc danh muc san pham-->
                <!--bat dau phan gioi thieu cong ty-->
                <div id="congy">
                <?php if($_SESSION['nn']=='vn'){
                    echo '<div class="tieude"><h3>công ty chúng tôi</h3></div>
                    <div class="noidung">
                        <p >CÔNG TY TNHHTM & DỊCH VỤ THUẬN VĨNH ĐẠT</p>
                        <p class="p1">Địa Chỉ: 63a Lê Sao, P.Phú Thạnh, Q.Tân Phú, TPHCM<br/>
                            Tel:(84-8) 39491295 - (84-8) 39491546<br/>
                            Fax:(84-8) 39492500
                            Email:tvd@thuanvinhdat.com<br/>
                            Website:quedt@thuanvinhdat.com
                        </p>
                    </div>';
                } ?>
                <?php if($_SESSION['nn']=='en'){
                    echo '<div class="tieude"><h3>our company</h3></div>
                    <div class="noidung">
                        <p>LIMITED LIABILITY COMPANY & COMMERCIAL SERVICES THUAN VINH DAT</p>
                        <p class="p1"> Address: 63A Le Sao, Phu Thanh Ward, Tan Phu District<br/>
                            Tel:(84-8) 39491295 - (84-8) 39491546<br/>
                            Fax:(84-8) 39492500
                            Email:tvd@thuanvinhdat.com<br/>
                            Website:quedt@thuanvinhdat.com
                        </p>
                    </div>';
                } ?>
                
                </div>
                <!--ket thuc phan gioi thieu cong ty-->
              
                <!-- bat dau lien he truc tuyen -->
                <div class="lienhetructuyen" >
                <?php
                    if($_SESSION['nn']=='vn'){ ?>
                        
                        <div class="tieude"><h3>Hỗ Trợ Trực Tuyến</h3></div>
                                <div class="tructuyen1">
                                     
                            <?php $sql1='select * from tbl_thong_tin_phong_ky_thuat';
                            $kq1=tep_db_query($sql1);
                            while($item3=tep_db_fetch_array($kq1)){
                                echo '<div><a href="ymsgr:sendIM?'.$item3['nick'].'" style="border: none;"><img style="text-align: center; margin-left: 57px; margin-top: 10px; border: none;"src="images/hotro1.jpg"/></a></div>
                                    <div style="text-align: center;margin-top: 5px;font-weight: bold;color: #414896; margin-bottom:10px;">'.$item3['ten_phong_ban'].'</div>

                                ';
                            } ?>
                        </div>
                    <?php 
                    }
                    if($_SESSION['nn']=='en'){?>
                        
                
                
                       <div class="tieude"><h3>online support</h3></div>
                        <div class="tructuyen1">
                             <?php $sql1='select * from tbl_thong_tin_phong_ky_thuat';
                            $kq1=tep_db_query($sql1);
                            while($item3=tep_db_fetch_array($kq1)){
                                echo '<div><a href="ymsgr:sendIM?'.$item3['nick'].'" style="border: none;"><img style="text-align: center; margin-left: 57px; margin-top: 10px; border: none;"src="images/hotro1.jpg"/></a></div>
                                    <div style="text-align:center;margin-top: 5px;font-weight: bold;color: #414896; margin-bottom:10px;">'.$item3['ten_phong_ban_en'].'</div>

                                ';
                            } ?>
                </div> 
                <?php   
                     }
                 ?>
                </div>
                    <!-- ket thuc lien he truc tuyen -->
                    
                <!--bat dau ty gia-->
                <div id="tygia">
                    <?php 
                        if($_SESSION['nn']=='vn'){?>
                            <div class="tieude"><h3>tỷ giá ngoại tệ</h3></div>
                            <div id="tigiangoaite">
                                <ul>
                                    <li style="background: url(images/bg_thoitiet.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/thoitiet/thoitiet.php' ?>">thời Tiết</a></li>
                                    <li style="background: url(images/bg_giavang.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/giavang/giavang.php' ?>">giá vàng hôm nay</a></li>
                                    <li style="background: url(images/bg_tigia.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.vietcombank.com.vn/exchangerates' ?>">tỷ giá ngoại tệ</a></li>
                                    <li style="background: url(images/bg_chungkhoan.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.hsx.vn/LS_VSE/HoSTC_Livesecurity.htm' ?>">chứng khoán trực tuyến</a></li>
                                </ul>
                            </div>
                    <?php     
                        }
                        if($_SESSION['nn']=='en'){?>
                            <div class="tieude"><h3>exchange rate</h3></div>
                            <div id="tigiangoaite">
                                <ul>
                                    <li style="background: url(images/bg_thoitiet.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/thoitiet/thoitiet.php' ?>">weather</a></li>
                                    <li style="background: url(images/bg_giavang.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/giavang/giavang.php' ?>">gold price today</a></li>
                                    <li style="background: url(images/bg_tigia.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.vietcombank.com.vn/exchangerates' ?>">exchange rate</a></li>
                                    <li style="background: url(images/bg_chungkhoan.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.hsx.vn/LS_VSE/HoSTC_Livesecurity.htm' ?>">online stock</a></li>
                                </ul>
                            </div>
                     <?php       
                        }
                    ?>                
                </div>  
                
                <!--doi tac than thien-->
                <div id="doitacthanthien">
                    <?php
                        if($_SESSION['nn']=='vn'){
                            echo '<div class="tieude"><h3>đối tác thân thiện</h3></div>';
                        } 
                        if($_SESSION['nn']=='en'){
                             echo '<div class="tieude"><h3>partner friendly</h3></div>';
                        }
                        $sql8='select * from tbl_doi_tac_than_thien';
                        $kq8=tep_db_query($sql8);
                        echo '<MARQUEE  height="410" sscrollAmount="1" direction="up" loop="true" truespeed scrolldelay="130" onMouseOver="this.stop()" onMouseOut="this.start()">
                            ';
                        while($item=tep_db_fetch_array($kq8)){
                            echo '<div id="hinhanh"><img src="admincp/upload/'.$item['hinh_anh'].'" /></div>';
                        }
                        echo '</MARQUEE>';
                    ?>
                    
                
                </div>
                <!--ket thuc doi tac than thien--> 
                <div id="songuoionline">
                <?php
                    if($_SESSION['nn']=='vn'){?>
                    <div class="tieude"><h3>số người online</h3></div>
                        <div id="thongkewebsite">
                    <div id="hinh_web"><img src="images/hinh_web.jpg"/></div>
                    <div id="thongtin">
                        <p>online:&nbsp;<?php echo '0'.$user_online; ?></p>
                        <p>Tổng Lượt:&nbsp;<?php echo $page_visited; ?></p>
                    </div>
                    <div class="clear"></div>
                   
                        <select class="lienket" onChange="MM_jumpMenu('parent',this,0)">
                            <option style="font-weight: bold;">chọn link liên kết website</option>
                            <?php $sql3='select * from tbl_lien_ket_web';
                                    $kq3=tep_db_query($sql3);
                                    while($item=tep_db_fetch_array($kq3)){
                                    
                                        echo '<option><a href="'.$item['ten_link_vn'].'">'.$item['ten_link_vn'].'</a></option>' ;
                                      
                                    }
                             ?>
                            
                        </select>
                  
                 </div>
                 <?php       
                    }
                    if($_SESSION['nn']=='en'){?>
                    <div class="tieude"><h3>number of people online</h3></div>
                    <div id="thongkewebsite">
                    <div id="hinh_web"><img src="images/hinh_web.jpg"/></div>
                    <div id="thongtin">
                        <p>Online:&nbsp;<?php echo '0'.$user_online; ?></p>
                        <p>Total Wiews:&nbsp;<?php echo $page_visited; ?></p>
                    </div>
                    <div class="clear"></div>
                   
                        <select class="lienket" onChange="MM_jumpMenu('parent',this,0)">
                            <option style="font-weight: bold;">selected links website</option>
                            <?php $sql3='select * from tbl_lien_ket_web';
                                    $kq3=tep_db_query($sql3);
                                    while($item=tep_db_fetch_array($kq3)){
                                    
                                        echo '<option><a href="'.$item['ten_link_en'].'">'.$item['ten_link_en'].'</a></option>' ;
                                      
                                    }
                             ?>
                            
                        </select>
                  
                 </div>
                    
                  <?php      
                    }
                 ?>
                </div>
                <!--so nguoi online-->
                
                <!--ket thuc so nguoi online-->
                <!--ket thuc ty gia-->
            </div>
                          
           
            <!-- ket thuc menu left -->
            
            <!-- bat dau content -->
            <div id="content">
                <!-- bat dau center -->
                <?php 
                    if($_GET['madanhmucsanpham']){
                        require_once('sanphamtheodanhmuc.php');
                    }
                     elseif($_GET['page'] && $_GET['page']=='sanpham'){
                        require_once('sanpham.php');
                    }
                    elseif($_GET['masp']){
                        require_once('chitietsanphammoi.php');
                    }
                     elseif($_GET['page'] && $_GET['page']=='tintuc'){
                        require_once('tintuc.php');
                    }
                    elseif($_GET['page'] && $_GET['page']=='dichvu'){
                        require_once('dichvu.php');
                    }
                    elseif($_GET['page'] && $_GET['page']=='lienhe'){
                        require_once('lienhe.php');
                    }
                     elseif($_GET['page'] && $_GET['page']=='FQAs'){
                        require_once('fqas.php');
                    }
                    elseif($_GET['page'] && $_GET['page']=='gioithieu'){
                        require_once('gioithieu.php');
                    }
                    else{              
                ?>
                 <?php 
                    if($_SESSION['nn']=='vn'){?>
                    <!--phan trang-->
                    <?php
                    $sql='SELECT count(id) as count FROM `tbl_danh_muc_san_pham` ';
                    $kq=tep_db_query($sql);
                    $item1=tep_db_fetch_array($kq);
                    //bat dau viet phan trang
                    $display=5;// so san pham xuat hien tren mot trang
                    $record=$item1['count'];//tong so san pham
                    if($record>$display){
                        $page=ceil($record/$display);
                    }
                    else{
                        $page=1;
                    }
                    $start=isset($_GET['start']) && (int)$_GET['start']?$_GET['start']:0;
                    $sql4='select * from tbl_danh_muc_san_pham limit '.$start.', '.$display.'';
                    $kq4=tep_db_query($sql4);
                    ?>
                    <!--ket thuc phan dau phan trang-->
                    <div id="center">
                            
                        <div id="show_sp_theo_dm">
                            <?php
                                while($item=tep_db_fetch_array($kq4)){ ?>
                                <div class="sp1">
                                  <div class="tieude_dm"><h3><?php echo ''.$item['ten_danh_muc_san_pham_vn'].'' ?></h3></div>  
                                  <div class="show_sp">
                            <?php 
                                    $sql7='select * from tbl_san_pham where ma_danh_muc_san_pham='.$item['id'].' limit 8';
                                    $kq7=tep_db_query($sql7);
                                    
                                    while($item1=tep_db_fetch_array($kq7)){ ?>
                                        <div class="show_sanpham">
                                            <div class="hinhanh_sp" style="margin-bottom: 10px;"><a href="<?php echo '?page=sanpham&masp='.$item1['id'].'&madanhmucsp='.$item1['ma_danh_muc_san_pham'].'&mode=detail' ?>"><img width="110" height="110"src="admincp/upload/<?php echo ''.$item1['hinh_anh'].'' ?>"/></a></div>
                                            <div class="tieude_sp">
                                                <div style="margin-top: 5px;" class="ten_sp_center"><a href="<?php echo '?page=sanpham&masp='.$item1['id'].'&madanhmucsp='.$item1['ma_danh_muc_san_pham'].'&mode=detail' ?>"><?php echo ''.$item1['ten_san_pham_vn'].'' ?></a></div>
                                                </div>
                                          
                                            <div class="clear"></div>
    
                                        </div>
    
                                  <?php      
                                    } ?>
                                   </div> 
                                </div>   
                              <?php  
                                }
                                 echo '<ul class="phantrang">';
                                    echo 'Trang:';
                                        if($page>1){
                                            $next=$start+$display;
                                            $prev=$start-$display;
                                            $current=($start/$display)+1;
                                            //hien thi phan trang prev
                                           
                                            if($current!=1){
                                               echo '<li><a href="?start='.$prev.'">Previous</a></li>'; 
                                            }
                                             //hien thi trang
                                             for($i=1;$i<=$page;$i++){
                                               if($current!=$i){
                                                    echo '<li><a href="?start='.$display*($i-1).'">'.$i.'</a></li>'; 
                                                } 
                                                else
                                                {
                                                   echo '<li class="current"><a href="?start='.$display*($i-1).'">'.$i.'</a></li>'; 
                                                }
                                                 
                                             }
                                            //hien thi next
                                            if($current!=$page){
                                                echo '<li><a href="?start='.$next.'">Next</a></li>';  
                                            }
                                        }
                                        else{
                                            echo '<li class="current" ><a href="?start=0">'.$page.'</a></li>';  
                                        }
                                            echo' </ul>';
                                ?>
                                <!--bat dau phan trang khuc thuc 2------>
                                
                                
                                <!--ket thuc khuc phan trang thu hai------->
                                
                             
                        </div>
                  </div>
                 <?php       
                    }
                 ?>
                 
                  <?php 
                    if($_SESSION['nn']=='en'){?>
                    <!--phan trang-->
                    <?php
                    $sql='SELECT count(id) as count FROM `tbl_danh_muc_san_pham` ';
                    $kq=tep_db_query($sql);
                    $item1=tep_db_fetch_array($kq);
                    //bat dau viet phan trang
                    $display=5;// so san pham xuat hien tren mot trang
                    $record=$item1['count'];//tong so san pham
                    if($record>$display){
                        $page=ceil($record/$display);
                    }
                    else{
                        $page=1;
                    }
                    $start=isset($_GET['start']) && (int)$_GET['start']?$_GET['start']:0;
                    $sql4='select * from tbl_danh_muc_san_pham limit '.$start.', '.$display.'';
                    $kq4=tep_db_query($sql4);
                    ?>
                    <!--ket thuc phan dau phan trang-->
                         <div id="center">
                            
                        <div id="show_sp_theo_dm">
                            <?php
                              while($item=tep_db_fetch_array($kq4)){ ?>
                                <div class="sp1">
                                  <div class="tieude_dm"><h3><?php echo ''.$item['ten_danh_muc_san_pham_en'].'' ?></h3></div>  
                                  <div class="show_sp">
                            <?php 
                                    $sql7='select * from tbl_san_pham where ma_danh_muc_san_pham='.$item['id'].' limit 8';
                                    $kq7=tep_db_query($sql7);
                                    
                                    while($item1=tep_db_fetch_array($kq7)){ ?>
                                        <div class="show_sanpham">
                                            <div class="hinhanh_sp" style="margin-bottom: 10px;"><a href="<?php echo '?page=sanpham&masp='.$item1['id'].'&madanhmucsp='.$item1['ma_danh_muc_san_pham'].'&mode=detail' ?>"><img width="110" height="110"src="admincp/upload/<?php echo ''.$item1['hinh_anh'].'' ?>"/></a></div>
                                            <div class="tieude_sp">
                                                <div style="margin-top: 5px;" class="ten_sp_center"><a href="<?php echo '?page=sanpham&masp='.$item1['id'].'&madanhmucsp='.$item1['ma_danh_muc_san_pham'].'&mode=detail' ?>"><?php echo ''.$item1['ten_san_pham_en'].'' ?></a></div>
                                                </div>
                                          
                                            <div class="clear"></div>
    
                                        </div>
    
                                  <?php      
                                    } ?>
                                   </div> 
                                </div>   
                              <?php  
                                }
                                echo '<ul class="phantrang">';
                                    echo 'Trang:';
                                        if($page>1){
                                            $next=$start+$display;
                                            $prev=$start-$display;
                                            $current=($start/$display)+1;
                                            //hien thi phan trang prev
                                           
                                            if($current!=1){
                                               echo '<li><a href="?start='.$prev.'">Previous</a></li>'; 
                                            }
                                             //hien thi trang
                                             for($i=1;$i<=$page;$i++){
                                               if($current!=$i){
                                                    echo '<li><a href="?start='.$display*($i-1).'">'.$i.'</a></li>'; 
                                                } 
                                                else
                                                {
                                                   echo '<li class="current"><a href="?start='.$display*($i-1).'">'.$i.'</a></li>'; 
                                                }
                                                 
                                             }
                                            //hien thi next
                                            if($current!=$page){
                                                echo '<li><a href="?start='.$next.'">Next</a></li>';  
                                            }
                                        }
                                        else{
                                            echo '<li class="current" ><a href="?start=0">'.$page.'</a></li>';  
                                        }
                                            echo' </ul>';
                             ?>
                        </div>
               
                </div>
                        
                 <?php       
                    }
                 }
                 ?>
                <!-- ket thuc center -->
                
                
                <!-- bat dau menu right -->
                <div id="menu_right">
                <?php 
                    if($_SESSION['nn']=='vn'){
                        
                ?>
                        <div id="sanphammoi">
                            <div class="tieude"><h3>sản phẩm mới</h3></div>
                             <MARQUEE  height="540" sscrollAmount="1" direction="up" loop="true" truespeed scrolldelay="130" onMouseOver="this.stop()" onMouseOut="this.start()">
                 
                            <div class="hinhanh_spnoibat">
                                <?php 
                                    $sql='select * from tbl_san_pham_moi order by id desc';  
                                    $kq=tep_db_query($sql);
                                    while($item=tep_db_fetch_array($kq)){
                                        echo '<a href="?masp='.$item['id'].'"><img  width="210" height="190" src="admincp/upload/'.$item['hinh_anh'].'"/></a>';
                                    }                            
                                ?>
                            </div>
                            </MARQUEE>
                        </div>
                        <div id="mucsanpham">
                            <div class="tieude"><h3>mục sản phẩm</h3></div>
                            <div class="hinhanh_mucsp">
                            <?php
                                $sql1='select * from tbl_san_pham order by id desc limit 8'; 
                                $kq1=tep_db_query($sql1);
                                while($item=tep_db_fetch_array($kq1)){?>
                                    <div class="hinhanh_sp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc_san_pham'].'&mode=detail' ?>"><img width="60" height="60" src="<?php echo 'admincp/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                    <div class="tieude_mucsp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc_san_pham'].'&mode=detail' ?>"><?php echo ''.$item['ten_san_pham_vn'].'' ?></a></div>
                                    <div style="color: #d5e1ea; text-align: center;">.............................................</div>
                                    <div class="clear"></div>
                            <?php
                                }
                            ?>
                                
                            </div>
                        </div>
                        <div id="tintuctieudiem">
                            <div class="tieude"><h3>tin tức tiêu điểm</h3></div>
                            <div class="hinhanh_tintuc">
                                <?php
                                $sql1='select * from tbl_tin_tuc where hien_len_trang_chu=1 order by id desc limit 6'; 
                                $kq1=tep_db_query($sql1);
                                while($item=tep_db_fetch_array($kq1)){?>
                                    <div class="hinhanh_sp"><a href="<?php echo '?page=tintuc&matintuc='.$item['id'].'&mode=detail' ?>"><img width="60" height="60" src="<?php echo 'admincp/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                    <div class="tieude_mucsp"><a href="<?php echo '?page=tintuc&matintuc='.$item['id'].'&mode=detail' ?>"><?php echo ''.$item['tieu_de_tin_tuc_vn'].'' ?></a></div>
                                    <div style="color: #d5e1ea; text-align: center;">.............................................</div>
                                    <div class="clear"></div>
                                <?php
                                    }
                                ?>
                            </div>
                        </div>
                <?php 
                    }
                ?>
                
                 <?php 
                    if($_SESSION['nn']=='en'){
                        
                ?>
                        <div id="sanphammoi">
                            <div class="tieude"><h3>new product</h3></div>
                            <MARQUEE  height="540" sscrollAmount="1" direction="up" loop="true" truespeed scrolldelay="130" onMouseOver="this.stop()" onMouseOut="this.start()">
                 
                            <div class="hinhanh_spnoibat">
                                 <?php 
                                    $sql='select * from tbl_san_pham_moi order by id desc';  
                                    $kq=tep_db_query($sql);
                                    while($item=tep_db_fetch_array($kq)){
                                        echo '<a href="?masp='.$item['id'].'"><img  width="210" height="190" src="admincp/upload/'.$item['hinh_anh'].'"/></a>';
                                    }                            
                                ?>
                            </div>
                            </MARQUEE>
                        </div>
                        <div id="mucsanpham">
                            <div class="tieude"><h3>Product Category</h3></div>
                            <div class="hinhanh_mucsp">
                            <?php
                                $sql1='select * from tbl_san_pham order by id desc limit 8'; 
                                $kq1=tep_db_query($sql1);
                                while($item=tep_db_fetch_array($kq1)){?>
                                    <div class="hinhanh_sp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc_san_pham'].'&mode=detail' ?>"><img width="60" height="60" src="<?php echo 'admincp/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                    <div class="tieude_mucsp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc_san_pham'].'&mode=detail' ?>"><?php echo ''.$item['ten_san_pham_en'].'' ?></a></div>
                                    <div style="color: #d5e1ea; text-align: center;">.............................................</div>
                                    <div class="clear"></div>
                            <?php
                                }
                            ?>
                                
                            </div>
                        </div>
                         <div id="tintuctieudiem">
                            <div class="tieude"><h3>News Focus</h3></div>
                            <div class="hinhanh_tintuc">
                                <?php
                                $sql1='select * from tbl_tin_tuc where hien_len_trang_chu=1 order by id desc limit 6'; 
                                $kq1=tep_db_query($sql1);
                                while($item=tep_db_fetch_array($kq1)){?>
                                    <div class="hinhanh_sp"><a href="<?php echo '?page=tintuc&matintuc='.$item['id'].'&mode=detail' ?>"><img width="60" height="60" src="<?php echo 'admincp/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                    <div class="tieude_mucsp"><a href="<?php echo '?page=tintuc&matintuc='.$item['id'].'&mode=detail' ?>"><?php echo ''.$item['tieu_de_tin_tuc_en'].'' ?></a></div>
                                    <div style="color: #d5e1ea; text-align: center;">.............................................</div>
                                    <div class="clear"></div>
                                <?php
                                    }
                                ?>
                            </div>
                        </div>
                <?php 
                    }
                ?>
                </div>               
                <!-- ket thuc menu right -->                
             <div class="clear"></div>
            
            <!-- ket thuc content -->
        </div>
        </div>
        <!-- ket thuc main -->
        
        <!-- bat dau footer -->
        <div id="footer">
            
             <div id="noidung_footer">
                <?php 
                    if($_SESSION['nn']=='vn'){
                        
                    
                ?>
                <div class="tt_cong_ty">
                    <p >CÔNG TY TNHH THƯƠNG MẠI & DỊCH VỤ THUẬN VĨNH ÐẠT</p>
                    <p class="p1">Ðịa Chỉ: 63a Lê Sao, P.Phú Thạnh, Q.Tân Phú, TPHCM<br/>
                        Tel:(84-8) 39491295 - (84-8) 39491546<br/>
                        Fax:(84-8) 39492500
                        Email:tvd@thuanvinhdat.com<br/>
                        Website:quedt@thuanvinhdat.com
                    </p>
                </div>
                 <div class="desgin">Design bởi công ty<a href="http://www.vietconnet.com" style="font-weight: bold; color: black;text-decoration: none;"> MẠNG KẾT NỐI VIỆT</a>
                 - cung cấp <a href="http://www.vietconnet.com/VN/Index.aspx?P=151&knv=1&knv1=1" style="font-weight: bold; color: black; text-decoration: none;">
                 thông tin doanh nghiệp</a>, 
                <a href="http://www.vietconnet.com/VN/Index.aspx?P=5" style="font-weight: bold;  color: black;text-decoration: none;">Thiết kế web</a>, 
                <a href="http://www.baogiaquangcaogoogle.com" style="font-weight: bold; color: black;text-decoration: none;">google adwords</a> hàng đầu VN.
                </div>
                 <?php
                 }
                 
                 if($_SESSION['nn']=='en')
                 {
                 ?>
                  <div class="tt_cong_ty">
                        <p>LIMITED LIABILITY COMPANY & COMMERCIAL SERVICES THUAN VINH DAT</p>
                        <p class="p1"> Address: 63A Le Sao, Phu Thanh Ward, Tan Phu District<br/>
                            Tel:(84-8) 39491295 - (84-8) 39491546<br/>
                            Fax:(84-8) 39492500
                            Email:tvd@thuanvinhdat.com<br/>
                            Website:quedt@thuanvinhdat.com
                        </p>
                   </div>
                    <div class="desgin">Design by Company<a href="http://www.vietconnet.com"  style="font-weight: bold; color: black;text-decoration: none;"> MANG KET NOI VIET</a>
                         - Providers <a href="http://www.vietconnet.com/VN/Index.aspx?P=151&knv=1&knv1=1"  style="font-weight: bold; color: black;text-decoration: none;" >
                          Business Information</a>, 
                        <a href="http://www.vietconnet.com/VN/Index.aspx?P=5"  style="font-weight: bold; color: black;text-decoration: none;"> Design Website</a>, 
                        <a href="http://www.baogiaquangcaogoogle.com"  style="font-weight: bold; color: black;text-decoration: none;"> google adwords</a> Vietnam the top.
                    </div>
                 <?php   
                 }
                 ?>
                 
        </div>
            
           
        </div>
        <!-- ket thuc footer -->
    
    </div>
    
    
    <!-- ket thuc warrper -->

</body>
</html>